package main

import (
	"fmt"
	"net/http"
	"strings"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		RemoteIp := r.RemoteAddr[:strings.Index(r.RemoteAddr, ":")]
		w.Write([]byte(RemoteIp))
		return
	})

	err := http.ListenAndServe(":9999", nil)
	if err != nil {
		fmt.Println(err)
	}
}
